<?php

use Illuminate\Database\Seeder;
use App\Models\ProductGoods;

class ProductGoodSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $faker = \Faker\Factory::create();
        // And now, let's create a few articles in our database:
        for ($i = 0; $i < 100; $i++) {
            ProductGoods::create([
                'product_name' => $faker->unique()->name,
                'product_unit' => $faker->randomElement(['桶', '个']),
                'product_sort_id' => $faker->numberBetween(1, 2),
                'product_brand_id' => $faker->numberBetween(1, 2),
                'product_image' => 'images/04142b825c58c562060a5b9ff69c042c.jpg',
                'product_detail_image_one' => 'images/3a9cfb0e00d1ee6cc06630de77592a8e.jpeg',
                'product_detail_image_two' => 'images/0b4ccbd5336a36cf02b16d9aec28d359.jpeg',
                'product_detail_image_three' => 'images/5595c5923fe9a7e97457838bc4b29824.jpg',
                'product_detail_image_four' => 'images/0f95d8f6fc2e547a0c3320bfb0d86756.png',
                'product_detail_image_five' => 'images/da13560e4dd668d461eb81257155c1cf.jpg',
                'product_rests_image' => 'images/679d1026b6ff6616ac5a2a248e2f051c.jpg',
                'product_retail_price' => $faker->randomFloat(2, 0, 220),
                'product_original_price' => $faker->randomFloat(2, 0, 220),
                'product_cost_price' => $faker->randomFloat(2, 0, 220),
                'product_label' => $faker->randomFloat(2, 0, 220),
                'product_coding' => $faker->unique()->name,
                'product_bar_code' => $faker->unique()->name,
                'product_add_type' => $faker->numberBetween(0, 2),
                'product_racking' => $faker->numberBetween(1, 2),
                'product_sales' => $faker->numberBetween(10, 200),
                'product_score' => $faker->numberBetween(10, 200),
                'product_stock' => $faker->numberBetween(20, 400),
                'product_audit_user_id' => $faker->numberBetween(5, 10),
                'product_add_user_id' => $faker->numberBetween(5, 10),
                'product_audit_status' => $faker->numberBetween(1, 2),
                'product_param' => $faker->randomDigitNotNull,
                'product_stock' => $faker->randomNumber(5, true),
                'product_source' => $faker->randomElement(['自营', '供应商']),
            ]);
        }

    }
}
